import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:wallet_utils/color.dart';
import 'package:wallet_utils/text_style.dart';

// 选择事项Item
// 以下页面会用到:
//    1. 手动编辑发票 选择发票类型
//    2. 结算账户页面 选择账户类型

class CheckItem extends StatelessWidget {
  final int? index;
  final String? content;
  final bool? state;
  final VoidCallback ontap;

  CheckItem({
    Key? key,
    required this.index,
    required this.content,
    required this.state,
    required this.ontap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: () => ontap(),
      child: Container(
        height: 57.w,
        alignment: Alignment.center,
        padding: EdgeInsets.only(left: 15.w, right: 15.w),
        // 下边框
        decoration: BoxDecoration(
          border: Border(
            bottom: BorderSide(width: 0.5.w, color: ColorManager.colorF4F4F4),
          ),
        ),
        child: Row(
          children: <Widget>[
            Container(
              padding: EdgeInsets.only(top: 1.w),
              child: Image.asset(
                state!
                    ? 'images/online_mall/user_privary_select.png'
                    : 'images/online_mall/icon_blank.png',
                width: 16.w,
                height: 16.w,
              ),
            ),
            SizedBox(width: 10.w),
            Text(
              content ?? '',
              style: TextStyleUtils.style2A2A2A(),
            ),
          ],
        ),
      ),
    );
  }
}
